import request from "@/utils/request";

/*
* 抢糖果活动 - 抢糖果活动配置列表
* */
export function sugarActivity({page, perPage}) {
  return request({
    url: "/sugar/activity",
    params: {page, perPage}
  })
}


/*
* 抢糖果活动 - 抢糖果活动配置删除
* */
export function delSugarActivity(id) {
  return request({
    url: "/sugar/activity",
    params: {id},
    method: "delete"
  })
}


/*
* 抢糖果活动 - 抢糖果活动配置新增
* */
export function addSugarActivity({
                                   is_open,
                                   activity_name,
                                   activity_gift_prize,
                                   point_name,
                                   first_sugar_num,
                                   second_sugar_num,
                                   third_sugar_num,
                                   start_time,
                                   end_time
                                 }) {
  return request({
    url: "/sugar/activity",
    data: {
      is_open,
      activity_name,
      activity_gift_prize,
      point_name,
      first_sugar_num,
      second_sugar_num,
      third_sugar_num,
      start_time,
      end_time
    },
    method: "post"
  })
}


/*
* 抢糖果活动 - 抢糖果活动配置修改
* */
export function alterSugarActivity({
                                   id,
                                   is_open,
                                   activity_name,
                                   activity_gift_prize,
                                   point_name,
                                   first_sugar_num,
                                   second_sugar_num,
                                   third_sugar_num,
                                   start_time,
                                   end_time
                                 }) {
  return request({
    url: "/sugar/activity/update",
    data: {
      id,
      is_open,
      activity_name,
      activity_gift_prize,
      point_name,
      first_sugar_num,
      second_sugar_num,
      third_sugar_num,
      start_time,
      end_time
    },
    method: "post"
  })
}



/*
* 抢糖果活动 - 抢糖果活动兑换记录
* */
export function getExchangeLog({page, per_page}) {
  return request({
    url: "/sugar/activity/get_exchange_log",
    params: {page, per_page}
  })
}




